/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.gatech.egg.l0cUs;

import edu.gatech.egg.l0cUs.service.QuestDao;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 *
 * This is a tub class whichwill bethe bis of modules.
 * I am teting things now.
 *
 * @author Summers
 */
@Component
public class StatusModuleBean implements ModuleBean, InitializingBean {

    @Autowired
    private QuestDao questDao;

    @Override
    public void initialize() {

    }

    @Override
    public String getTitle() {
        return "Hello World Module";
    }

    @Override
    public String getOutput() {
        StringBuilder  toReturn = new StringBuilder();
        toReturn.append("<ul>")
                    .append("<li>")
                        .append("Current Players: 0")
                    .append("</li>")
                    .append("<li>")
                        .append("Current Qusts: ").append(questDao.findAll().size())
                    .append("</li>")
                    .append("<li>")
                        .append("Current Progress: 0")
                    .append("</li>")
                .append("</ul>");
        return toReturn.toString();
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        assert questDao!=null;
    }

}
